import request from '@/utils/request'

export const apiLogin = (data) => {
  return request({
    url: '/rm2/userApi/login',
    method: 'POST',
    data,
    type: 'form',
    noMessage: true,
  })
}

// 获取用户详细信息
export function getLoginUserInfo(data) {
  return request({
    url: '/rm2/userApi/getLoginUserInfo',
    method: 'POST',
    data,
    type: 'form',
  })
}

export const apiGetMenu = (data) => {
  return request({
    url: '/rm2/userAuth/getMenu',
    method: 'POST',
    data,
    type: 'file',
  })
}

// 登录后切换ab角
export const chooseAbRoleAfterLogin = (data) => {
  return request({
    url: '/rm2/userMaint/chooseAbRoleAfterLogin',
    method: 'POST',
    data,
  })
}

//修改密码
export const apiUpdatePassword = (data) => {
  return request({
    url: '/rm2/userMaint/updatePassword',
    method: 'POST',
    data,
    type: 'json',
  })
}
// 获取项目列表
export const apiListProject = (data) => {
  return request({
    url: '/rm2/frontPrjMaint/listProject',
    method: 'POST',
    data,
    type: 'json',
  })
}
/**
 * 获取用户所有页面路由
 */
export const apiUserAuthRouters =(params)=>{
  return request({
    url: '/rm2/userAuth/getPageRouters',
    method: 'POST',
    params,
    type: 'form',
  })
  // return  apiRequestPostFormData('/rm2/userAuth/getPageRouters', params)
}